1. Field of the Invention
The present invention relates to a block management method and a data writing method for flash memory, and a flash memory storage system and a flash memory controller using the same.
2. Description of Related Art
Along with the widespread of digital cameras, cell phones, and MP3 in recently years, the consumers' demand to storage media has increased drastically. Flash memory is one of the most adaptable memories for such battery-powered portable products due to its characteristics such as data non-volatility, low power consumption, small volume, and non-mechanical structure. A flash disc is a storage apparatus adopting NAND flash memory as storage medium. Flash memory has been broadly used for storing important personal data thanks to its small volume and large capacity. Therefore, the flash memory industry has become a very important part of the electronic industry in recent years.
In general, flash memory is composed of a plurality of physical blocks. A controller of a flash memory storage system groups the physical blocks into a plurality of physical units and groups the physical units into a data area and a spare area for management. The physical units belonging to the data area are used for storing valid data written by a write command, and the physical units belonging to the spare area are used for replacing the physical units of the data area during the execution of the write command. To enable the host system to properly access the physical units that store data in an alternate mechanism, the flash memory storage system provides logical units to the host system. That is, the flash storage system may establish a logical unit-physical unit mapping table, and record and update mapping relationships between the logical addresses and the physical blocks in the data area in the logical unit-physical unit mapping table to reflect the alternation of the physical units. More specifically, when the flash memory storage system receives the write command from the host system to write data into a logical unit, the flash memory storage system gets one physical unit from the spare area, and copies valid data stored in a physical unit originally mapped to the logical unit and the new data into the physical unit gotten from the spare area. Further, the flash memory storage system performs an erasing operation on the physical unit originally mapped to the logical unit and associate the erased physical unit with the spare area, and re-maps the logical unit to the physical unit storing the new data in the logical unit-physical unit mapping table (i.e., the physical unit storing the new data is associated with the data area). Thus, the host system simply accesses data based on the logical units while the flash memory storage system reads data from or writes data into the mapped physical unit according to the logical unit-physical unit mapping table.
However, the capacity of each physical block becomes more and more large because of the progress of semiconductor manufacture processes, and thus the time for moving valid data relatively becomes longer and the performance of the flash memory storage system is decreased. In particular, when the flash memory storage system is used as a storage medium for installing a computer operation system, the computer operation system may access data (e.g., a file allocation table) stored in some logical units, frequently. Frequently accessing this kind of small file will cause the time for performing the moving of valid data to become longer. Additionally, the controller of the flash memory storage system needs to frequently organize valid data to release physical units only storing invalid data due to the frequent access. Therefore, how to increase the efficiency of writing data in a flash memory is one of the major subjects in the industry.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.